<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="com.crm.util.Constants"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.crm.entity.Opportunity"%>
<%@page import="com.crm.entity.Business"%>
<%@page import="com.crm.entity.Executives"%>
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/temp.dwt" codeOutsideHTMLIsLocked="false" -->
<%@page import="com.crm.entity.Clientdet"%>
<%@ page language="java" import="java.sql.*,java.util.*"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<link href="<%=application.getContextPath()%>/css/css-crm.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<%=application.getContextPath()%>/css/datatable.css"/>
<link rel="stylesheet" href="<%=application.getContextPath()%>/css/jquery-ui-1.8.17.custom.css"/>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-1.6.min.js"></script>	
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-ui-1.8.17.custom.min.js"></script>	
<script type="text/javascript" language="javascript" src="<%=application.getContextPath()%>/js/jquery.dataTables.nightly.js"></script>
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		$('#reportTable').dataTable();
	} );
</script>
<script type="text/javascript">
function  openWindow(){
	//Pending Enquiries Alert Start
	$.ajax({
		url:"<%=application.getContextPath()%>/adminhome/alerts.do",
		mimetype: "text/html",
		cache:false,
		success: function(res){
			$("#alertSearchBox").html(res);	
		}
	});
	$('#alertdialog').dialog({autoOpen: false,modal: true,width: 1024,height: 768}).dialog('open');
	//Pending Enquiries Alert End
	
	
	//Bank Guarenty Alert Start
    $.ajax({
		url:"<%=application.getContextPath()%>/supplyOrder/bankalerts.do",
		mimetype: "text/html",
		cache:false,
		success: function(res){
			$("#bankSearchBox").html(res);	
		}
	});
	$('#bankDialog').dialog({autoOpen: false,modal: true,width: 1024,height: 768}).dialog('open');
	//Bank Guarenty Alert End
	
	
	//Invoice Alert Start
    $.ajax({
		url:"<%=application.getContextPath()%>/invoiceStatus/invoiceAlerts.do",
		mimetype: "text/html",
		cache:false,
		success: function(res){
			$("#invoiceSearchBox").html(res);	
		}
	});
	$('#invoiceDialog').dialog({autoOpen: false,modal: true,width: 1024,height: 768}).dialog('open');
  //Invoice Alert End
}
</script>

</head>

<body onload="javascript:openWindow();">

<div id="main" >
 
   <%@ include file="common/header.jsp" %>
  <%@ include file="common/submenu.jsp" %>
   <div id="content">
   <div id="work-area2">
 	<div class="boxIFS2">
	 
	  <div id="demo">
	    <table width="100%" id="reportTable" cellpadding="4" cellspacing="1" bgcolor="#C5E4EB">
	    <thead>
          <tr>
            <th width="30" height="30" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"  style="background-repeat:repeat-x">S.No</th>
            <th width="109" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Reference Number </th>
            <th width="109" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Enquiry Number </th>
            <th width="109" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Client</th>
            <th width="109" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Division</th>
            <th width="109" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Enquiry Type</th>
            <th width="109" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Due Date</th>
            <th width="109" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Status</th>
          </tr>
          </thead>
          <tbody>
           <%  
           List<Opportunity> oplst=(List<Opportunity>)request.getAttribute("opplist");
           if(oplst!=null){
            	 
      	      	for(int i=0;i<oplst.size();i++){ 
      	      	 java.sql.Date d=oplst.get(i).getDuedate();
    			SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy");
    			String dat=sdf.format(d);
           %>
          <tr >
            <td bgcolor="#FFFFFF" align="center"><%=i+1 %></td>
            <td align="center" valign="top" ><a href="<%=application.getContextPath() %>/editEnq/setSrchEnq.do?refNo=<%=oplst.get(i).getRefNum()%>"><%=oplst.get(i).getRefNum() %></a></td>
            <td bgcolor="#FFFFFF" align="center" valign="top" ><%=oplst.get(i).getEnqnum() %></td>
            <td bgcolor="#FFFFFF" align="center" valign="top" ><%=oplst.get(i).getOrganisation() %></td>
            <td bgcolor="#FFFFFF" align="center" valign="top" ><%=oplst.get(i).getDivision() %></td>
            <td bgcolor="#FFFFFF" align="center" valign="top" ><%=oplst.get(i).getEnquirytype() %></td>
            <td bgcolor="#FFFFFF" align="center" valign="top" ><%=dat %></td>
            <td bgcolor="#FFFFFF" align="center" valign="top" ><%=oplst.get(i).getStatus() %></td>
          </tr>
       <%
 			
   	      	}
           }
       %>
       </tbody>
        </table>
     	  </div>
	  </div>
	  <div id="alertdialog"   title="Pending Enquiries" style="display: none;">
                  <div id="alertSearchBox"></div>

</div>
<div id="bankDialog"   title="Pending BankGuarentee Details" style="display: none;">
                  <div id="bankSearchBox"></div>

</div>
<div id="invoiceDialog"   title="Pending Invoice Details" style="display: none;">
                  <div id="invoiceSearchBox"></div>

</div>
	  </div>
     </div><div id="footer"></div>  
</div>
</body>
</html>
